Code
cor(pooled_data$p_vra, pooled_data$ssq_full)[1] 0.3877125
RQ1 : Is there an association between anxiety before undergoing VR and side effect severity after VR exposure?
cor(pooled_data$p_vra, pooled_data$ssq_full)[1] 0.3877125
figure_1 <- ggplot(pooled_data, aes(x = p_vra, y = ssq_full)) +
geom_point() +
geom_smooth(method = "lm", formula = y ~ x, se = FALSE) +
labs(title = "Side Effect Severity vs VR Anxiety",
x = "VR Anxiety",
y = "Side Effect Severity")
ggplotly(figure_1)model = lm(ssq_full ~ p_vra, data = pooled_data)
figure_2 <- ggplot(model, aes(x = .fitted, y = .resid)) +
geom_point() +
geom_hline(yintercept = 0, linetype = "dashed", colour = "red") +
labs(title = "Residual Plot")
ggplotly(figure_2)summary(model)
Call:
lm(formula = ssq_full ~ p_vra, data = pooled_data)
Residuals:
Min 1Q Median 3Q Max
-32.977 -10.385 -3.590 7.204 86.410
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 3.7997 1.4447 2.630 0.00893 **
p_vra 2.5968 0.3378 7.687 1.7e-13 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 15.75 on 334 degrees of freedom
Multiple R-squared: 0.1503, Adjusted R-squared: 0.1478
F-statistic: 59.09 on 1 and 334 DF, p-value: 1.697e-13
The correlation between VR anxiety and side effect severity shows \(0.388\), indicating low positive correlation. Figure 1 supports linear relationship between two variables. Figure 2 reinforces the relationship by showing approximately random and same variances in vertical direction along the fitted axis (homoscedasticity). In conclusion, linear model between those two variables are appropriateclear
Given that the assumptions of the linear model are satisfied, performing a regression test is appropriate. The regression results in the summary statistics show a p-value of \(1.7 \times 10^{-13}\). Assuming a significance level of \(0.05\), we reject the null hypothesis (\(H_0: \text{slope} = 0\)), indicating that the alternative hypothesis (\(H_1: \text{slope} \neq 0\)) is supported. This suggests a significant linear relationship between VR anxiety and side effect severity. The relationship is described by the following regression equation:
\[Side Effect Severity = 2.5968 * (VR Anxiety) + 3.7997\]
pooled_binary <- pooled_data %>%
mutate(
PSTAI_1_bin = case_when(
PSTAI_1 %in% c("Very Much", "Moderately", "Somewhat") ~ 1,
PSTAI_1 == "Not at all" ~ 0,
TRUE ~ NA_real_
),
PSTAI_2_bin = case_when(
PSTAI_2 %in% c("Very Much", "Moderately", "Somewhat") ~ 1,
PSTAI_2 == "Not at all" ~ 0,
TRUE ~ NA_real_
),
PSTAI_4_bin = case_when(
PSTAI_4 %in% c("Very Much", "Moderately", "Somewhat") ~ 1,
PSTAI_4 == "Not at all" ~ 0,
TRUE ~ NA_real_
),
PSTAI_6_bin = case_when(
PSTAI_6 %in% c("Very Much", "Moderately", "Somewhat") ~ 1,
PSTAI_6 == "Not at all" ~ 0,
TRUE ~ NA_real_
)
)
pooled_melt <- melt(pooled_binary,
id.vars = "ssq_full",
measure.vars = c("PSTAI_1_bin", "PSTAI_2_bin", "PSTAI_4_bin", "PSTAI_6_bin"),
variable.name = "PSTAI_var",
value.name = "Binary")
pooled_melt <- pooled_melt %>%
mutate(Label = ifelse(PSTAI_var == "PSTAI_1_bin", "Calm",
ifelse(PSTAI_var == "PSTAI_2_bin", "Tension",
ifelse(PSTAI_var == "PSTAI_4_bin", "Relaxed",
ifelse(PSTAI_var == "PSTAI_6_bin", "Worry", NA)))),
Label = factor(Label, levels = c("Calm", "Relaxed", "Tension", "Worry")),
Binary = factor(Binary, levels = c(0,1), labels = c("Negative","Positive")))
ggplot(pooled_melt, aes(x = Label, y = ssq_full, fill = Binary)) +
geom_boxplot(position = position_dodge(width = 0.8), width = 0.6, outlier.shape = NA) +
scale_fill_manual(values = c("Positive" = "#377eb8", "Negative" = "#e41a1c")) +
labs(title = "Distribution of Side Effect Severity Scores by PSTAI Group",
x = "PSTAI Variable",
y = "Side Effect Severity",
fill = "PSTAI Group") +
theme_minimal()PSTAI data on the 4-point Likert scale were aggregated into two categories: “Positive” (“Very much”, “Somewhat”, “Moderately”) and “Negative” (“Not at all”). A comparative bar plot showed that side effect severity aligned with anxiety, as indicated by higher reports of tension and worry and lower reports of relaxation and calmness, consistent with established markers of anxiety (American Psychiatric Association, 2022).
This is evidenced by the median scores of the side effect severity, where it reveals higher median “Negative” scores for Calm and Relaxed, and higher median “Positive” scores for Tension and Worry.
median_expect <- median(pooled_data$expect, na.rm = TRUE)
pooled_data$expect_group <- ifelse(pooled_data$expect <= median_expect, "Low", "High")
p <- ggplot(pooled_data, aes(x = expect_group, y = ssq_full, fill = expect_group)) +
geom_boxplot() +
labs(
title = "Side Effect Severity by Expectancy Group",
x = "Expectancy Group",
y = "Side Effect Severity"
) +
theme(
plot.title = element_text(hjust = 0.5)
)
interactive_plot <- ggplotly(p)
interactive_plotWhen looking at the box plot above, the High expectancy group median generally shows higher severity outcomes compared to the Low expectancy group median. The High group also has a wider IQR, pointing to greater variation in symptom severity among those with higher expectancy. Expectancy was divided by whether scores were above or below the overall median. One noticeable feature is an outlier in the Low group, which may explain why the difference between the two groups was less clear in the first analysis.
Taken together, these findings suggest that higher expectancy is associated with stronger VR symptom reporting and greater variability, possibly reflecting increased anxiety in those with high or negative expectancy (Steinman et al., 2013), leading to more severe side effects.
Code Chunks. (n.d.). Rmarkdown.rstudio.com. https://rmarkdown.rstudio.com/lesson-3.html
Title Blocks – Quarto. (2018). Quarto. https://quarto.org/docs/authoring/title-blocks.html
American Psychiatric Association. (2022). Diagnostic and statistical manual of mental disorders (5th ed., text rev.). Arlington, VA: American Psychiatric Publishing.
Steinman, S. A., Smyth, F. L., Bucks, R. S., MacLeod, C., & Teachman, B. A. (2013). Anxiety-linked expectancy bias across the adult lifespan. Cognition & Emotion, 27(2), 345–355. https://doi.org/10.1080/02699931.2012.711743